import jdk.jfr.StackTrace;

import java.util.Scanner;


public class test {
    public static void main(String[] args) {
        String Activityname = new Scanner(System.in).next();
        char[] strs = Activityname.toCharArray();
        //将字符串转化为数组
        String sql = "select * from activity where activity like '%";
        for (int i = 0; i < strs.length; i++) {
            sql = sql + strs[i]+"%";
            if(i==strs.length-1)
            {
                sql = sql + "'";
            }//将模糊搜索转化出来
        }
        sql = sql + "or content like '%";
        for (int i = 0; i < strs.length; i++) {
            sql = sql + strs[i]+"%";
            if(i==strs.length-1)
            {
                sql = sql + "'";
            }//将模糊搜索转化出来
        }
        System.out.println(sql);
    }
}
